package com.easy.service.impl;

import com.easy.bean.Cart;
import com.easy.dao.CartDao;
import com.easy.service.ICartService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class CartService implements ICartService {
    @Autowired
    CartDao cartDao;

    @Override
    public List<Cart> cartList(int userid) {
        return cartDao.cartList(userid);
    }

    @Override
    public List<Cart> getCartList(Page page, String text) {
        return cartDao.getCartList(page,text);
    }

    @Override
    public int CartCount(String text) {
        return cartDao.CartCount(text);
    }

    @Override
    public int addCart(Cart cart) {
        return cartDao.addCart(cart);
    }

    @Override
    public int editCart(Cart cart) {
        return cartDao.editCart(cart);
    }

    @Override
    public int deleteCart(int userid, int proid) {
        return cartDao.deleteCart(userid,proid);
    }

    @Override
    public double totalPrice(int userid) {
        return cartDao.totalPrice(userid);
    }

    @Override
    public int deletechecked(int userid) {
        return cartDao.deletechecked(userid);
    }
}
